//计算并显示指定日期的后一天
#include "stdio.h"

int main(int argc, char const *argv[])
{

  struct date
  {
    int year;
    int month;
    int day;
  };

  struct date today, tomorrow;

  const int daysPerMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

  printf("Enter today's date (yyyy mm dd): ");

  scanf("%i%i%i", &today.year, &today.month, &today.day);

  if (today.day < daysPerMonth[today.month - 1])
  {
    tomorrow.year = today.year;
    tomorrow.month = today.month;
    tomorrow.day = today.day + 1;
  }
  else if (today.month == 12)
  {
    //年末
    tomorrow.year = today.year + 1;
    tomorrow.month = 1;
    tomorrow.day = 1;
  }
  else
  {
    //月末
    tomorrow.year = today.year;
    tomorrow.month = today.month + 1;
    tomorrow.day = 1;
  }

  printf("Tomorrow's date is %i/%.2i/%.2i\n", tomorrow.year, tomorrow.month, tomorrow.day);

  return 0;
}
